package com.example.demo.zabbix.request.builder.service;

import com.example.demo.zabbix.request.BaseRequest;
import com.example.demo.zabbix.request.builder.request.RequestBuilder;

import java.util.HashMap;
import java.util.Map;

/**
 * https://www.zabbix.com/documentation/4.0/manual/api/reference/service/adddependencies
 */
public class ServiceAddDependenciesRequestBuilder extends RequestBuilder<Map<String,Object>> {
    private String serviceId;
    private String dependsOnServiceId;
    private Integer soft;
    public ServiceAddDependenciesRequestBuilder(String auth) {
        super("service.adddependencies", auth);
        baseRequest.setParams(new HashMap<>());
    }

    public ServiceAddDependenciesRequestBuilder(Long id, String auth) {
        super("service.adddependencies", id, auth);
        baseRequest.setParams(new HashMap<>());
    }

    public String getServiceId() {
        return serviceId;
    }

    public ServiceAddDependenciesRequestBuilder setServiceId(String serviceId) {
        this.serviceId = serviceId;
        return this;
    }

    public String getDependsOnServiceId() {
        return dependsOnServiceId;
    }

    public ServiceAddDependenciesRequestBuilder setDependsOnServiceId(String dependsOnServiceId) {
        this.dependsOnServiceId = dependsOnServiceId;
        return this;
    }

    public Integer getSoft() {
        return soft;
    }

    public ServiceAddDependenciesRequestBuilder setSoft(Integer soft) {
        this.soft = soft;
        return this;
    }

    public ServiceAddDependenciesRequestBuilder setParam(String key, Object value){
        baseRequest.getParams().put(key,value);
        return this;
    }

    public ServiceAddDependenciesRequestBuilder setParams(Map<String,Object> params){
        baseRequest.getParams().putAll(params);
        return this;
    }

    @Override
    public BaseRequest<Map<String, Object>> builder() {
        baseRequest.getParams().put("serviceid",serviceId);
        baseRequest.getParams().put("dependsOnServiceid",dependsOnServiceId);
        baseRequest.getParams().put("soft",soft);
        return baseRequest;
    }
}
